import express from 'express'
import { Server } from 'socket.io'
// import { Lib } from 'lance-gg'
// import WiggleServerEngine from './WiggleServerEngine'
// import WiggleGameEngine from '../common/WiggleGameEngine'
const PORT = process.env.PORT || 3000
// define routes and socket
const server = express()

const handler = server.listen(PORT, () => console.log(`Listening on ${PORT}`))

const io = new Server(handler)

// Game Instances
const gameEngine = new WiggleGameEngine({ traceLevel: Lib.Trace.TRACE_NONE })
const serverEngine = new WiggleServerEngine(io, gameEngine, {
  debug: {},
  updateRate: 6
})

// start the game
serverEngine.start()
